import java.util.HashSet;
import java.util.Set;

public class Leetcode1189 {
    public static void main(String[] args) {
        System.out.println(maxNumberOfBalloons("leetcode"));
    }

    public static int maxNumberOfBalloons(String text) {
        char[] chars = text.toCharArray();
        int[] count = new int[26];
        for (char c : chars) {
            ++count[c - 'a'];
        }

        return Math.min(count[0], Math.min(count[1], Math.min(count[11] / 2, Math.min(count[14] / 2, count[13]))));
    }
}
